import { MockMethod } from 'vite-plugin-mock';
import { resultPageSuccess, resultSuccess } from '../_util';

const demoList = (() => {
  const result: any[] = [];
  for (let index = 0; index < 60; index++) {
    result.push({
      id: `${index}`,
      name: '@ctitle',
      'cartegoryId_dictText|1': ['家具', '文具', '耗材', '电子产品', '电器'],
      'useState_dictText|1': ['在用', '停用'],
      positionId_dictText: '@city()',
      code: '@string(lower,10)',
      rfid: '@string(lower,16)',
      userId_dictText: '@cname',
      'custodyDepartmentId_dictText|1': ['业务部', '销售部', '综合部', '技术部'],
    });
  }
  return result;
})();

enum Api {
  list = '/asset-info/assetInfo/list',
  save = '/asset-info/assetInfo/add',
  edit = '/asset-info/assetInfo/edit',
  deleteOne = '/asset-info/assetInfo/delete',
  deleteBatch = '/asset-info/assetInfo/deleteBatch',
  importExcel = '/asset-info/assetInfo/importExcel',
  exportXls = '/asset-info/assetInfo/exportXls',
}

const prefix = '/jeecgboot';
export default [
  // {
  //   url: prefix + Api.list,
  //   timeout: 1000,
  //   method: 'get',
  //   response: ({ query }) => {
  //     const { page = 1, pageSize = 20 } = query;
  //     return resultPageSuccess(page, pageSize, demoList);
  //   },
  // },
  // {
  //   url: prefix + Api.save,
  //   timeout: 1000,
  //   method: 'post',
  //   response: () => {
  //     return resultSuccess('ok');
  //   },
  // },
  // {
  //   url: prefix + Api.edit,
  //   timeout: 1000,
  //   method: 'post',
  //   response: () => {
  //     return resultSuccess('ok');
  //   },
  // },
  // {
  //   url: prefix + Api.deleteOne,
  //   timeout: 1000,
  //   method: 'delete',
  //   response: () => {
  //     return resultSuccess('ok');
  //   },
  // },
  // {
  //   url: prefix + Api.importExcel,
  //   timeout: 1000,
  //   method: 'post',
  //   response: () => {
  //     return resultSuccess('ok');
  //   },
  // },
  // {
  //   url: prefix + Api.exportXls,
  //   timeout: 1000,
  //   method: 'get',
  //   response: () => {
  //     return resultSuccess('ok');
  //   },
  // },
] as MockMethod[];
